package com.example.netdemo.repository

import androidx.lifecycle.LiveData
import com.example.netdemo.api.LoginApi
import com.example.netdemo.base.BaseRepository
import com.example.netdemo.model.LoginModel
import com.example.netdemo.retrofit.Resource
import io.reactivex.disposables.Disposable

class LoginRepository private constructor() : BaseRepository() {
    companion object {
        val instance by lazy { LoginRepository() }
    }

    private val loginApi : LoginApi by lazy {
        create(LoginApi::class.java)
    }

    fun login(params: Map<String, Any>) : Pair<LiveData<Resource<LoginModel>>, Disposable> {
        return loginApi.login(params).commonHandle()
    }
}